/**
 * VUEshop
 * ============================================================================
 * * 版权所有 2015-2027 深圳搜豹网络科技有限公司，并保留所有权利。
 * 网站地址: http://www.vueshop.com.cn
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
 * 不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
 * $Author: soubao-java 2020-07-22 $
 */<template>
	<div>
		<div class="item-title">
			<a class="back" href="javascript:history.back(-1)" title="返回列表">
			  <i class="fa fa-arrow-circle-o-left"></i>
			</a>
			<div class="subject">
				<h3>拼团管理 - 拼团详情</h3>
				<h5>查看/编辑商家发布的拼团活动</h5>
			</div>
		</div>

		<el-form ref="form" :model="form" label-width="200px" label-position="right">
			<el-form-item label="店铺名称">
				<el-input :value="form.store.store_name" disabled></el-input>
			</el-form-item>
			<el-form-item label="拼团标题">
				<el-input v-model="form.act_name" disabled></el-input>
			</el-form-item>
			<el-form-item label="活动类型">
				<el-input disabled :value="teamTypeFormat(form)"></el-input>
			</el-form-item>
			<el-form-item label="拼团商品">
				<el-input v-model="form.goods_name" disabled></el-input>
			</el-form-item>
			<el-form-item label="成团人数">
				<el-input v-model="form.needer" disabled></el-input>
			</el-form-item>
			<el-form-item label="购买限制数">
				<el-input v-model="form.time_limit" disabled></el-input>
			</el-form-item>
			<el-form-item label="虚拟销售基数">
				<el-input v-model="form.virtual_num" disabled></el-input>
			</el-form-item>
			<el-form-item label="分享标题">
				<el-input v-model="form.share_title" disabled></el-input>
			</el-form-item>
			<el-form-item label="分享描述">
				<el-input v-model="form.share_desc" disabled></el-input>
			</el-form-item>
			<el-form-item label="状态">
				<el-input :value="statusFormat(form)" disabled></el-input>
			</el-form-item>
		</el-form>
	</div>
</template>

<script>
	import {
		getTeam
	} from "@/utils/api";
	export default {
		data() {
			return {
				form: {
					store: {
						store_name: ''
					}
				}
			};
		},
		components: {},
		created() {
			this.getTeam();
		},
		methods: {
			getTeam() {
				var that = this;
				getTeam(this.$route.params.team_id)
				.then(function(res) {
					that.form = res;
				});
			},
			teamTypeFormat(row) {
				if (row.team_type == 0) {
					return "分享团"
				}
				if (row.team_type == 1) {
					return "佣金团"
				}
				if (row.team_type == 2) {
					return "抽奖团"
				}
				return "无类型"
			},
			statusFormat(row) {
				if (row.is_lottery == 1) {
					return "已开奖"
				}
				if (row.status == 0) {
					return "审核中"
				}
				if (row.status == 1) {
					return "进行中"
				}
				if (row.status == 2) {
					return "审核失败"
				}
				if (row.status == 2) {
					return "管理员关闭"
				}
				return "无状态"
			},
		}
	};
</script>
<style scoped>
</style>
